<?php

namespace App\Models\Cart;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Cart extends Model
{
    use HasFactory;
    protected $guarded = [];

    //关联商品
    public function goods(){
        return $this->hasOne(Good::class,'id','goods_id');
    }

    //关联规格
    public function spec(){
        return $this->hasOne(SpecGoods::class,'id','spec_goods_id');
    }
}
